package cn.sixmillions.yuqueblog.entity;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @description: 知识库目录实体类
 * @author: sixmillions
 * @since: 2021/12/12
 **/
@Data
@Accessors(chain = true)
public class Doc implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 文档编号
     */
    private Long id;

    /**
     * 文档路径
     */
    private String slug;

    /**
     * 标题
     */
    private String title;

    /**
     * 文档创建人 user_id
     */
    @JSONField(name = "user_id")
    private Long userId;

    /**
     * 描述了正文的格式 [lake, markdown]
     */
    private String format;

    /**
     * 公开状态 [1 - 公开, 0 - 私密]
     */
    @JSONField(name = "public")
    private Integer publicType;

    /**
     * 状态 [1 - 正常, 0 - 草稿]
     */
    private Integer status;

    /**
     * 喜欢数量
     */
    @JSONField(name = "likes_count")
    private Long likesCount;

    /**
     * 评论数量
     */
    @JSONField(name = "comments_count")
    private Integer commentsCount;

    /**
     * 文档内容更新时间
     */
    @JSONField(name = "content_updated_at")
    private LocalDateTime contentUpdatedAt;

    /**
     * 最后修改人
     */
    @JSONField(name = "last_editor")
    private User lastEditor;

    /**
     * 仓库编号，就是 repo_id
     */
    @JSONField(name = "book_id")
    private Long bookId;

    @JSONField(name = "draft_version")
    private Integer draftVersion;

    @JSONField(name = "read_status")
    private Integer readStatus;

    /**
     * 最后一次编辑者id
     */
    @JSONField(name = "last_editor_id")
    private Long lastEditorId;

    /**
     * 字数统计
     */
    @JSONField(name = "word_count")
    private Integer wordCount;


    /**
     * 创建时间
     */
    @JSONField(name = "created_at")
    private LocalDateTime createdAt;

    @JSONField(name = "published_at")
    private LocalDateTime publishedAt;

    /**
     * 更新时间
     */
    @JSONField(name = "updated_at")
    private LocalDateTime updatedAt;


    /**
     * 第一次创建时间
     */
    @JSONField(name = "first_published_at")
    private LocalDateTime firstPublishedAt;

    /**
     * 自定义描述
     */
    @JSONField(name = "custom_description")
    private String customDescription;


    /**
     *
     */
    @JSONField(name = "view_status")
    private Integer viewStatus;

}
